using UnityEngine;

public class C_Boss生成器 : MonoBehaviour
{
	public string _BossName;

	public GameObject _BossPrefab;

	public C_传送区域 _C_传送区域;

	private void Start()
	{
		if (_BossPrefab == null)
		{
			Debug.LogError("<<" + _BossName + ">>预制体不存在");
		}
		else if (!MonoSingleton<MyDataManager>.Instance.F_判断Boss是否已经击败(_BossName))
		{
			GameObject gameObject = Object.Instantiate(_BossPrefab, base.transform.position, Quaternion.identity);
			if (_BossName != "幽魂" && _C_传送区域 != null)
			{
				_C_传送区域._IsBoss房 = true;
				_C_传送区域._Boss已击败 = false;
				gameObject.GetComponent<IBoss>().F_监听Boss死亡(delegate
				{
					_C_传送区域._Boss已击败 = true;
				});
			}
		}
		else
		{
			Debug.LogError("<<" + _BossName + ">>已击败或不存在");
		}
	}
}
